Ext.define('Ext.ux.form.ValidationCode',{
	extend:'Ext.Container', 
    initComponent : function() {  
            Ext.apply(this, {
                items : [ {  
                    xtype : 'label',  
                    id : 'validationCode',  
                    text:this.createCode(),  
                    style:'font-size: 20px; color: #CC0000;background-color:#6699FF',  
                    listeners : {  
                        render : function() {  
                            Ext.fly(this.el).on('click', function(e, t) {  
                                Ext.getCmp("validationCode").setText(this.createCode());  
                            });  
                        },  
                        scope : this  
                    }  
                } ]  
            });  
		this.callParent(arguments);
        },
	createCode : function () {  
        code = "";  
        var codeLength = 4;    
        var random = new Array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 'A', 'B', 'C',  
                'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O',  
                'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z');//随机数    
        for (var i = 0; i < codeLength; i++) {    
            var index = Ext.Number.randomInt ( 0, 33 ) ;    
            code += random[index];  
        }  
        sessionStorage.setItem("DragonApp", code);  
    }  
});